<?php
/**
 * Created by PhpStorm.
 * User: huawei
 * Date: 2021/11/1
 * Time: 11:55
 */

namespace app\index\home;

use app\common\controller\Base;
use think\App;
use think\facade\Session;

class Common extends Base
{
    /**
     * organizationCode组织code， 组织code如下:
     * 集团 ：organization_ASuu0myA
     * 湾中 ：organization_11hMO8ja
     * 轨交 ：organization_KIiBvEqV
     * 湾东 ：organization_Vb9rv47X
     * 湾西 ：organization_kIJkusb8
     * 华中 ：organization_guN7mouM
     * 华东 ：organization_1aHTPZOK
     * 北方 ：organization_TsnYW0Kb
     * 西南： organization_IrOaUOpG
     * @var array
     */
    public $areas=[
        "ASuu0myA"=>"集团",
        "11hMO8ja"=>"湾中",
        "KIiBvEqV"=>"轨交",
        "Vb9rv47X"=>"湾东",
        "kIJkusb8"=>"湾西",
        "guN7mouM"=>"华中",
        "1aHTPZOK"=>"华东",
        "TsnYW0Kb"=>"北方",
        "IrOaUOpG"=>"西南"
    ];

    public $userkey = "user";
    public function __construct(App $app = null)
    {
        parent::__construct($app);
        if(!Session::has($this->userkey)){
            loginMsg("请先登录");
        };
        $user = Session::get($this->userkey);

        define("USER",$user['id']);
        define("USERID",$user['userId']);
        define("AREA",$user['area']);
        define("NICKNAME",$user['nickname']);
//        define("USERID","oKTJA5bsSe6P_OgcA0UGBubhGXU4");
//        define("USER",5);
//        define("AREA","ASuu0myA");
    }
}